<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
require_once ('../db_conn.php');
$recc=isset($_GET['recc'])?$_GET['recc']:"";
if($recc>0)
{
$sql="SELECT * FROM  tb_ltcp1 where id=$recc";
$at=$db->query($sql);
$adrow=$at->fetch_array(MYSQLI_BOTH);
}


$rec=isset($_GET['rec'])?$_GET['rec']:"";

if ($rec>0)
{
    $type=$_POST['name'];
    $id=$_POST['sort'];

    $sql="update tb_ltcp1 set id='$id',type='$type' where id='$rec' LIMIT 1";
    $rs=$db->query($sql);
        if ($rs==FALSE)
    {
        echo "<script language='javascript' type='text/javascript'>";
        echo "alert('修改失败！');";
        echo "window.location.href='product_category.php'";
        echo "</script>";
    }
    else
    {
        echo "<script language='javascript' type='text/javascript'>";
        echo "alert('修改成功！');";
        echo "window.location.href='product_category.php'";
        echo "</script>";  
    }
    }
if($recc>0)
{
require ('add_product_category_html1.php');
}
 else {
    require ('product_category.php');
}





